import { expect } from 'chai'

class {
    onMount() {
        var components = window.components || (window.components = {});
        components["one-arg-array"] = this;
    }

    handleColorClick(color) {
        this.color = color[0];
    }

    test(helpers) {
        var liEls = this.el.querySelectorAll("li");

        helpers.triggerMouseEvent(liEls[0], "click");
        expect(this.color).to.equal("red");

        helpers.triggerMouseEvent(liEls[1], "click");
        expect(this.color).to.equal("green");

        helpers.triggerMouseEvent(liEls[2], "click");
        expect(this.color).to.equal("blue");
    }
}

<div>
    <ul>
        <for|color| of=input.colors>
            <li onClick("handleColorClick", [color])>${color}</li>
        </for>
    </ul>
</div>